package com.huawei.M01.iterator.F23;

import java.util.ArrayList;
import java.util.List;

/**
 * 循环码排列
 *
 * @author 111
 */
public class CircularPermutation {
    public List<Integer> circularPermutation(int n, int start) {
        List<Integer> result = new ArrayList<>();

        result.add(start);

        for (int i = 1; i <= n; i++) {
            int size = result.size();
            for (int j = size - 1; j >= 0; j--) {
                result.add((result.get(j) ^ start) | (1 << (i - 1)) ^ start);
            }
        }
        return result;
    }

    public static void main(String[] args) {
        System.out.println(1 << 1);
    }
}
